<?php

header("content-type:text/html;chartset=utf-8");


        
        
    if( $_POST){
        
        include 'request.php';
        
        $url = '192.168.33.10/gmasiatech/merchant/process.php';

        $_POST['method'] = 'reqTransactionQueryByTime';

        $res2 = sendRequest($url, $_POST);
        
        $res2 = json_decode($res2, 1);
       
        
        if( $res2['code'] == '001'){
            $desc = '请求成功.';

        }elseif($res2['code'] == '100'){
            $desc = '商户不存在.';
        }elseif($res2['code'] == '101'){
            $desc = '有参数无效.';
        }elseif($res2['code'] == '102'){
            $desc = 'Sign验证失败.';
        }elseif($res2['code'] == '103'){
            $desc = 'TransId已存在.';
        }elseif($res2['code'] == '104'){
            $desc = '单次交易金额未达要求.';
        }elseif($res2['code'] == '105'){
            $desc = '总交易金额未达要求.';
        }elseif($res2['code'] == '106'){
            $desc = '网络错误.';
        }elseif($res2['code'] == '107'){
            $desc = '交易不存在.';
        }elseif($res2['code'] == '108'){
            $desc = '银行账户不存在.';
        }
   

     
        
        if(is_array($res2['data'])){
            foreach ($res2['data'] as $key => $value) {
                
                echo $key.'.  transactionId: '.$value['transactionId'].'  createtion: '.$value['creationtime'].'.  status: '.$value['status'].'<br>';
            }
        }else{
            echo '<h1>';
        echo '返回值：'.'_'.$desc.'没有数据';
        echo '</h1>';
        }
        
        
        
    }
   

?>

<!DOCTYPE html>

<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <style>
        tr{margin-bottom: 15px;}
        tr td:first-child{text-align: right;padding-right: 10px;font-weight: bold}
        form  input:not(.submit){height:30px;width:200px;}
        .readonly{border:1px solid #ccc;color:#888;}
        em{font-size: 14px;}
    </style>
</head>

<h5><a href="index.html">回到首页</a></h5>
<h3>Fund In.</h3>
<hr>

<form action="" method="post">
<table CellSpacing=10>
   <tr><td>merchantId:</td>         <td><input type="text" name="merchantId"  value="MDP54aa92882cd7c"  > <em>真实数据：商户的mdpId</em>
   
   <tr><td>starttime:</td>         <td><input type="date" name="starttime"  > <em>开始时间</em>

   <tr><td>endtime:</td>         <td><input type="date" name="endtime"  > <em>结束时间</em>

 
   
   <tr><td>SUBMIT:</td>             <td><input type="submit" value="GO"  class="submit" >
</table>
</form>